package com.workcell.workdata.im.model.vo;

import com.workcell.workdata.im.entity.Comment;
import com.workcell.workdata.im.entity.Moment;

import java.util.Date;
import java.util.List;

public class MomentVO {

    private Long id;

    private Long uid;

    private String text;

    private String content;

    private Byte type;

    private String extra;

    private Date createTime;

    private List<Comment> commentList;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUid() {
        return uid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Byte getType() {
        return type;
    }

    public void setType(Byte type) {
        this.type = type;
    }

    public String getExtra() {
        return extra;
    }

    public void setExtra(String extra) {
        this.extra = extra;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public List<Comment> getCommentList() {
        return commentList;
    }

    public void setCommentList(List<Comment> commentList) {
        this.commentList = commentList;
    }

    public static MomentVO of(Moment moment){
        if (moment == null){
            return null;
        }
        MomentVO vo = new MomentVO();
        vo.uid = moment.getUid();
        vo.content = moment.getContent();
        vo.id = moment.getId();
        vo.extra = moment.getExtra();
        vo.type = moment.getType();
        vo.text = moment.getText();
        vo.createTime = moment.getCreateTime();
        return vo;
    }
}
